home *** CD-ROM | disk | FTP | other *** search
- Path: solon.com!not-for-mail
- From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
- Newsgroups: comp.lang.c,comp.lang.c.moderated
- Subject: Re: const pointer confusion...
- Date: 29 Mar 1996 05:55:30 -0600
- Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
- Sender: clc@solutions.solon.com
- Approved: clc@solutions.solon.com
- Message-ID: <4jgj3i$s5q@solutions.solon.com>
- References: <4j06gm$7oa@solutions.solon.com> <4j6354$3ge@solutions.solon.com> <4ja3uf$pe8@solutions.solon.com> <4jcklh$9u3@solutions.solon.com>
- NNTP-Posting-Host: solutions.solon.com
-
- In article <4jcklh$9u3@solutions.solon.com>,
- Lawrence Kirby <fred@genesis.demon.co.uk> wrote:
- >Still wrong! :-)
- >
- >It is a constraint violation which the compiler must diagnose.
- >
- >6.5.3 constraints:
- >
- >"The same type qualifier shall not appear more than once in the same
- > specifier list or qualifier list, either directly or via one or more
- > typedefs."
-
- Oops, missed that one. Thus _no_ specifier can appear more than once in the
- specifier list, really. Duplicate or contradictory storage classes are clearly
- out as are duplicate/contradictory type specifiers.
-
- So, concisely written, you can have at most one type qualifier of each kind
- (const, volatile), at most one storage class and at most one type specifier, in
- whatever order you wish.
-
- >>Your compiler is producing a misleading diagnostic. There is no invalid type
- >>combination here. The error is one of a redunant ``const'', which is not
- >>forbidden by the C language.
- >
- >The compiler is correct.
-
- Amazing! :)
-
- My apologies for contributing B.S. to the contrary.
- --
-